package com.cuiweiyou.vigilesmicrecord.base;

import android.app.Application;
import android.content.Context;
import android.os.Build;
import android.os.StrictMode;

import com.cuiweiyou.vigilesmicrecord.util.comm.UncaughtExceptionUtil;

/**
 * Created by macpro on 2018/4/18.
 */

public class CApplication extends Application {

    private static Context context;

    @Override
    public void onCreate() {
        super.onCreate();
        context = getApplicationContext();
        UncaughtExceptionUtil.getInstance().init(context, ContantValue.getCrashPath());

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            StrictMode.VmPolicy.Builder builder = new StrictMode.VmPolicy.Builder();
            StrictMode.setVmPolicy(builder.build());
        }
    }

    public static Context getContext() {
        return context;
    }
}

